//package org.demo.cnck.controller.filter;
//
//import org.demo.cnck.controller.error.UnauthorizedException;
//import org.demo.cnck.dao.constant.SystemConstant;
//import org.demo.cnck.dao.domain.User;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.util.AntPathMatcher;
//
//import javax.servlet.*;
//import javax.servlet.annotation.WebFilter;
//import javax.servlet.http.HttpServletRequest;
//import java.io.IOException;
//
///**
// * Created by cdyoue on 2018/11/20.
// */
//@WebFilter(filterName = "accessFilter", urlPatterns = "/**")
//@Configuration
//public class AccessFilter implements Filter {
//
//    private AntPathMatcher antPathMatcher = new AntPathMatcher();
//
//    @Override
//    public void init(FilterConfig filterConfig) throws ServletException {
//        //todo
//    }
//
//    @Override
//    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
//        HttpServletRequest request = (HttpServletRequest) servletRequest;
//        String servletPath = request.getServletPath();
//        if (antPathMatcher.match("/system/**", servletPath)) {
//            filterChain.doFilter(servletRequest, servletResponse);
//            return;
//        }
//
//        User user = (User) request.getSession().getAttribute(SystemConstant.USER_SESSION_KEY);
//        if (null == user) {
//            servletResponse
//        }
//    }
//
//    @Override
//    public void destroy() {
//        //todo
//    }
//}
